<template>
  <div class="readlist">
    <p class="recommend">
      <span><img src="../img/biji.png" alt="" />推荐阅读</span>
    </p>
    <ul class="list">
      <li v-for="item in list" :key="item._id">
        <div class="left">
<<<<<<< HEAD
          <img :src="item.imgs" />
=======
          <img src="../../curriculum/img/gad.png" alt="" />
>>>>>>> wangjiaojiao
        </div>
        <div class="right">
          <!-- <h1>
            {{ item.nm }}
            <i v-if="item.version" class="ver1">{{ item.version }}</i
            ><i v-if="item.version.includes(' ')" class="ver2">{{
              item.version
            }}</i>
          </h1> -->

          <p class="destruction">垃圾快乐，正在毁灭中国孩子！{{ item.text }}</p>
          <p class="method">
            毁掉一个孩子最快乐的方法是什么？{{ item.content }}
          </p>
          <p class="revelation">育儿启示</p>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: null,
    };
  },
  mounted() {
    this.getlist();
  },

  methods: {
    getlist() {
      fetch(
        "https://www.fastmock.site/mock/1403d720fc3170df8c1fc00c0ced5ddf/api/api"
      )
        .then((response) => response.json()) // //第一个then可以将原始数据转换为json对象
        .then((res) => {
          console.log(res);
          this.list = res;
          //第二个then接收的才是后台传过来的真正的数据
          console.log(this.list);
        });
    },
  },
};
</script>
<style lang="less" scoped>
.readlist {
  width: 100%;
<<<<<<< HEAD
  margin: 0 auto;
  height: 530px;
=======
  margin: 10px;
  margin-bottom: 20px;
  height: 100%;
  font-weight: 500;
>>>>>>> wangjiaojiao
  .recommend {
    height: 50px;
    font-size: 18px;

    img {
      display: inline-block;
      width: 28px;
      height: 30px;
    }
  }
  .list {
    width: 100%;
<<<<<<< HEAD
    height: 445px;
    background: #fff;
    border: 2px solid rgb(223, 220, 220);
    border-radius: 5%;
=======
    height: 100%;
    background: #fff;
    border: 2px solid rgb(250, 246, 246);
    border-radius: 5%;
    padding: 20px 0;
    margin-bottom: 20px;
    box-shadow: 2px -2px 5px #989898;

>>>>>>> wangjiaojiao
    li {
      width: 100%;
      height: 106px;
      display: flex;
<<<<<<< HEAD
      border-bottom: 1px dotted #333;
=======
      border-bottom: 1px dashed #333;
      padding-top: 20px;
      padding-left: 10px;
      // vertical-align: middle;
>>>>>>> wangjiaojiao

      .left {
        width: 70px;
        height: 70px;
<<<<<<< HEAD
        background: turquoise;
        margin: 0 8px;
        // vertical-align: middle;
=======
        // margin: 0 8px;
        // vertical-align: middle;
        img {
          width: 70px;
          height: 70px;
          border-radius: 15%;
        }
>>>>>>> wangjiaojiao
      }
      .right {
        width: 100%;
        height: 100px;
<<<<<<< HEAD
=======
        margin-left: 10px;
>>>>>>> wangjiaojiao
        position: relative;
        // vertical-align: middle;
        .destruction {
          font-size: 16px;
<<<<<<< HEAD
=======
          margin-bottom: 10px;
>>>>>>> wangjiaojiao
        }
        .method {
          font-size: 12px;
          color: #666;
<<<<<<< HEAD
=======
          margin-bottom: 10px;
>>>>>>> wangjiaojiao
        }
        .revelation {
          font-size: 10px;
          position: absolute;
          right: 10px;
<<<<<<< HEAD
          bottom: 5px;
          color: #32dfff;
          background: #e8fcff;
          padding: 0 5px;
=======
          bottom: 20px;
          color: #32dfff;
          background: #daeef1;
          margin-bottom: 10px;
          padding: 0 5px;
          border-radius: 5%;
>>>>>>> wangjiaojiao
        }
      }
    }
  }
}
</style>
